package com.example.demo.controller;

import com.example.demo.domain.Order;
import com.example.demo.order.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * Created by fandg on 2020/3/31.
 */
@RestController
@RequestMapping("order")
public class OrderController {

    @Autowired
    OrderService orderService;

    @RequestMapping("/list")
    public List<Order> orderList() {
        return orderService.orderList();
    }

    @RequestMapping("/one")
    public Order getOrder(Long id) {
        return orderService.getOrder(id);
    }
}
